﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ctrl="clr-namespace:SQLDataTransferer.Controls"
                    xmlns:viewModel="clr-namespace:SQLDataTransferer.ViewModel"
                    xmlns:view="clr-namespace:SQLDataTransferer.Views">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Resources/RibbonTheme.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <DataTemplate DataType="{x:Type viewModel:TransferViewModel}" >
        <view:TransferView/>
    </DataTemplate>

    <DataTemplate DataType="{x:Type viewModel:AttachDatabaseViewModel}" >
        <view:AttachDatabaseView/>
    </DataTemplate>

    <DataTemplate DataType="{x:Type viewModel:DetachDatabaseViewModel}" >
        <view:DetachDatabaseView/>
    </DataTemplate>

    <DataTemplate DataType="{x:Type viewModel:SettingsViewModel}" >
        <view:SettingsView/>
    </DataTemplate>
    
    <DataTemplate x:Key="ClosableTabItemTemplate">
        <DockPanel Width="Auto">
            <ctrl:ExtendedButtonImage Command="{Binding Path=CloseCommand}"                    
                                      Cursor="Hand"
                                      DockPanel.Dock="Right"
                                          ToolTip="Close"
                                      Focusable="False"
                                      Margin="0,0,0,0"
                                      Padding="0"
                                      VerticalContentAlignment="Center"
                                      HorizontalContentAlignment="Center"
                                      VerticalAlignment="Center"
                                      HorizontalAlignment="Center"                    
                                      Width="16" 
                                      Height="16"
                                      Template="{StaticResource btnImgFlat}"
                                      ImageSource="/SQLDataTransferer;component/Images/cross.png">
            </ctrl:ExtendedButtonImage>
            <ContentPresenter Content="{Binding Path=DisplayName}"
                              VerticalAlignment="Stretch"
                              Margin="0,0,10,0"/>
        </DockPanel>
    </DataTemplate>

    <DataTemplate x:Key="WorkspacesTemplate">
        <TabControl IsSynchronizedWithCurrentItem="True" 
                    ItemsSource="{Binding}"
                    ItemTemplate="{StaticResource ClosableTabItemTemplate}"
                    Margin="4">
        </TabControl>
    </DataTemplate>
</ResourceDictionary>